/*    */ package eos.moe.dragoncore;
/*    */ 
/*    */ import java.awt.Graphics2D;
/*    */ import java.awt.image.BufferedImage;
/*    */ import java.awt.image.ImageObserver;
/*    */ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
/*    */ import net.minecraft.client.renderer.texture.TextureUtil;
/*    */ import net.minecraft.client.resources.IResourceManager;
/*    */ import net.minecraft.util.ResourceLocation;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class nk
/*    */   extends TextureAtlasSprite
/*    */ {
/* 21 */   public BufferedImage w = null;
/*    */ 
/*    */ 
/*    */   
/* 25 */   public int q = -1;
/*    */   public String g;
/*    */   
/*    */   public nk(String str) {
/* 29 */     super("NONE");
/* 30 */     this.g = str;
/*    */   }
/*    */   
/*    */   public boolean hasCustomLoader(IResourceManager iResourceManager, ResourceLocation resourceLocation) {
/* 34 */     return true;
/*    */   }
/*    */ 
/*    */   
/*    */   public boolean updateIcon(BufferedImage bufferedImage) {
/* 39 */     this.field_130223_c = this.field_130224_d = Math.max(bufferedImage.getHeight(), bufferedImage.getWidth());
/* 40 */     if (bufferedImage.getWidth() != bufferedImage.getHeight()) {
/* 41 */       BufferedImage bufferedImage1 = new BufferedImage(this.field_130223_c, this.field_130223_c, 7);
/* 42 */       Graphics2D graphics2D = bufferedImage1.createGraphics();
/* 43 */       graphics2D.drawImage(bufferedImage, (this.field_130223_c - bufferedImage.getWidth()) / 2, (this.field_130223_c - bufferedImage.getHeight()) / 2, (ImageObserver)null);
/* 44 */       graphics2D.dispose();
/* 45 */       bufferedImage = bufferedImage1;
/*    */     } 
/*    */     
/* 48 */     this.w = bufferedImage;
/* 49 */     func_110971_a(this.field_130223_c, this.field_130224_d, 0, 0, false);
/*    */     
/* 51 */     onImageUpdate();
/* 52 */     return true;
/*    */   }
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   public void onRemove() {
/* 59 */     if (this.q != -1) {
/* 60 */       TextureUtil.func_147942_a(this.q);
/* 61 */       this.q = -1;
/*    */     } 
/*    */   }
/*    */ 
/*    */ 
/*    */   
/*    */   public void onPreRender() {}
/*    */ 
/*    */ 
/*    */   
/*    */   public int getTextureId() {
/* 72 */     return this.q;
/*    */   }
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   public void onImageUpdate() {
/* 79 */     if (this.q != -1) onRemove(); 
/* 80 */     this.q = TextureUtil.func_110996_a();
/* 81 */     TextureUtil.func_110987_a(this.q, this.w);
/*    */   }
/*    */ 
/*    */   
/*    */   public void func_110971_a(int i, int j, int k, int m, boolean bool) {
/* 86 */     super.func_110971_a(i, j, k, m, bool);
/*    */     
/* 88 */     int[][] arrayOfInt = new int[1][];
/* 89 */     arrayOfInt[0] = new int[func_94211_a() * func_94216_b()];
/* 90 */     this.w.getRGB(k, m, func_94211_a(), func_94216_b(), arrayOfInt[0], 0, func_94211_a());
/* 91 */     func_130103_l();
/* 92 */     this.field_110976_a.add(arrayOfInt);
/*    */   }
/*    */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\nk.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */